//
//  BaseNavigationController.swift
//  RxSwiftExample
//
//  Created by lxf on 2021/11/23.
//

import UIKit

class BaseNavigationController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        
        setNavigationBarAppearance()
        
    }
    
    
}

extension BaseNavigationController {
    
    func setNavigationBarAppearance() {
        
//        if #available(iOS 11.0, *) {
//            self.navigationBar.prefersLargeTitles = true
//        } else {
//            // Fallback on earlier versions
//        }
        self.navigationBar.barTintColor = .red
        self.navigationBar.isTranslucent = true
        self.navigationBar.tintColor = .green
        
        if #available(iOS 13.0, *) {
            let appearance = UINavigationBarAppearance.init()
            appearance.configureWithOpaqueBackground()
            appearance.backgroundColor = UIColor.red
            appearance.shadowImage = UIImage.init()
            appearance.shadowColor = UIColor.clear
            self.navigationBar.standardAppearance = appearance
            self.navigationBar.scrollEdgeAppearance = appearance
        } else {
            // Fallback on earlier versions
        }
        
    }
    
}
